﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="原料异议处理.aspx.cs" Inherits="syc.Store.原料异议处理" %>
<html>
<head>
<title></title>
</head>
<body>
<asp:Label ID="SqlText" runat="server" Text="" Visible="false"></asp:Label>
<asp:Label ID="SelectedID" runat="server" Text="0" Visible="false"></asp:Label>
<asp:Label ID="CurrentID" runat="server" Text="0" Visible="false"></asp:Label>

<asp:SqlDataSource ID="SqlDataSource2" runat="server"
ConnectionString="<%$ ConnectionStrings:SCMConnectionString1 %>" ></asp:SqlDataSource>
<asp:SqlDataSource ID="SqlDataSource3" runat="server" 
ConnectionString="<%$ ConnectionStrings:SCMConnectionString1 %>" 
SelectCommand="SELECT [ID], 名称 FROM 原料供货单位 union select 0 as [ID] , '全部' as 名称">
</asp:SqlDataSource>

<asp:SqlDataSource ID="SqlDataSource4" runat="server" 
ConnectionString="<%$ ConnectionStrings:SCMConnectionString1 %>" 
SelectCommand="SELECT [ID], 名称 FROM 原料供货单位">
</asp:SqlDataSource>

<script type="text/javascript" language="javascript" src="/common.js"></script>

<form id="form1" runat="server">
<div id="wintop" class="wintop">原料异议处理</div>

<asp:Panel ID="Panel1" runat="server" CssClass="panel">
    <asp:Button ID="Button_New" runat="server" Text="录 入" CssClass="button" UseSubmitBehavior="False" onclick="Button_New_Click"/>
    <asp:Button ID="Button_Delete" runat="server" Text="删 除" CssClass="button" UseSubmitBehavior="False" Visible="false" onclick="Button_Delete_Click" OnClientClick="if(!confirm('确认要删除该条记录吗？'))return(false);"/>
    <asp:Button ID="Button_ShowQuery" runat="server" Text="隐藏查询栏" CssClass="button" UseSubmitBehavior="False" onclick="Button_ShowQuery_Click" Font-Bold="false" />
</asp:Panel>


<asp:Panel ID="Panel3" runat="server" CssClass="panel" GroupingText="录 入" Visible="false">

    <span style="display:inline-block;width:60px;text-align:right;">原料类别：</span><asp:DropDownList ID="YuanLiao2" runat="server" 
    DataSourceID="SqlDataSource2" DataTextField="品名" DataValueField="ID" Width="115px" Font-Size="12px">
    </asp:DropDownList>
    <span style="display:inline-block;width:86px;text-align:right;">供货单位：</span><asp:DropDownList ID="GongHuo2" runat="server" 
    DataSourceID="SqlDataSource4" DataTextField="名称" DataValueField="ID" Width="115px">
    </asp:DropDownList>
    <span style="display:inline-block;width:86px;text-align:right;">使用单位：</span><asp:DropDownList ID="FenChang2" Width="115px"
        runat="server">
        <asp:ListItem Text="一分厂" Value="1"></asp:ListItem>
        <asp:ListItem Text="二分厂" Value="2"></asp:ListItem>
        <asp:ListItem Text="三分厂" Value="3"></asp:ListItem>
        <asp:ListItem Text="四分厂" Value="4"></asp:ListItem>
        <asp:ListItem Text="五分厂" Value="5"></asp:ListItem>
    </asp:DropDownList>
    <span style="display:inline-block;width:60px;text-align:right;">库区：</span><asp:TextBox
        ID="KuQu2" runat="server" Width="60px"></asp:TextBox>
    <br />
    <span style="display:inline-block;width:60px;text-align:right;">炉　　号：</span><asp:TextBox
        ID="LuHao2" runat="server" Width="115px"></asp:TextBox>
    <span style="display:inline-block;width:86px;text-align:right;">支　　数：</span><asp:TextBox
        ID="ZhiShu2" runat="server" Width="115px"></asp:TextBox>
    <span style="display:inline-block;width:86px;text-align:right;">重　　量：</span><asp:TextBox
        ID="Zhong2" runat="server" Width="115px"></asp:TextBox>吨
    <br />
    <span style="display:inline-block;width:60px;text-align:right;">日　　期：</span><asp:TextBox
        ID="Date3" runat="server" Width="115px"></asp:TextBox><img alt="" src="/Icons/29.png" align="middle" onclick="makecalendar(document.getElementById('Date3').value, document.getElementById('Date3'));" />
    <span style="display:inline-block;width:70px;text-align:right;">备　　注：</span><asp:TextBox
        ID="BeiZhu2" runat="server" Width="320px"></asp:TextBox>
    <asp:CheckBox ID="YiChuLi" Text="已处理" runat="server" AutoPostBack="True" OnCheckedChanged="YiChuLi_OnCheckedChanged" />
    <br />
    <span style="display:inline-block;width:60px;text-align:right;">处理日期：</span><asp:TextBox
        ID="Date4" runat="server" Width="115px" Enabled="false"></asp:TextBox><img alt="" src="/Icons/29.png" align="middle" onclick="var Date4=document.getElementById('Date4');if(!Date4.disabled)makecalendar(Date4.value, Date4);" />
    <span style="display:inline-block;width:70px;text-align:right;">处理方式：</span><asp:TextBox
        ID="ChuLi2" runat="server" Width="320px" Enabled="false"></asp:TextBox>

    <asp:Button ID="Button_Save" runat="server" Text="保存" CssClass="button" onclick="Button_Save_Click" />
    <asp:Button ID="Button_Cancel" runat="server" Text="取消" CssClass="button" onclick="Button_Cancel_Click"  />
</asp:Panel>

<asp:Panel ID="Panel2" runat="server" CssClass="panel" GroupingText="查 询">
    <span style="display:inline-block;width:60px;text-align:right;">原料类别：</span><asp:DropDownList ID="YuanLiao" runat="server" 
    DataSourceID="SqlDataSource2" DataTextField="品名" DataValueField="ID" Width="115px">
    </asp:DropDownList>
    <span style="display:inline-block;width:86px;text-align:right;">供货单位：</span><asp:DropDownList ID="GongHuo" runat="server" 
    DataSourceID="SqlDataSource3" DataTextField="名称" DataValueField="ID" Width="115px">
    </asp:DropDownList>
    <span style="display:inline-block;width:86px;text-align:right;">使用单位：</span><asp:DropDownList ID="FenChang" Width="115px"
        runat="server">
        <asp:ListItem Text="全部" Value="0"></asp:ListItem>
        <asp:ListItem Text="一分厂" Value="1"></asp:ListItem>
        <asp:ListItem Text="二分厂" Value="2"></asp:ListItem>
        <asp:ListItem Text="三分厂" Value="3"></asp:ListItem>
        <asp:ListItem Text="四分厂" Value="4"></asp:ListItem>
        <asp:ListItem Text="五分厂" Value="5"></asp:ListItem>
    </asp:DropDownList>
    <br />
    <span style="display:inline-block;width:60px;text-align:right;">炉　　号：</span><asp:TextBox
        ID="LuHao" runat="server" Width="115px"></asp:TextBox>
    <span style="display:inline-block;width:86px;text-align:right;">起始日期：</span><asp:TextBox
        ID="Date1" runat="server" Width="115px"></asp:TextBox><img alt="" src="/Icons/29.png" align="middle" onclick="makecalendar(document.getElementById('Date1').value, document.getElementById('Date1'));" />
    <span style="display:inline-block;width:70px;text-align:right;">截止日期：</span><asp:TextBox
        ID="Date2" runat="server" Width="115px"></asp:TextBox><img alt="" src="/Icons/29.png" align="middle" onclick="makecalendar(document.getElementById('Date2').value, document.getElementById('Date2'));" />
    <asp:Button ID="Button1" runat="server" Text="查 询" CssClass="button" onclick="Button_Query_Click"  />
</asp:Panel>

<asp:Panel ID="Panel4" runat="server" CssClass="panel2">
    <asp:Label ID="Message" runat="server" Text="·准备就绪" CssClass="prompt"></asp:Label>
</asp:Panel>
    
<div class="gridframe">
    <div class="gridview">
    
        <table border="1" width="100%" cellspacing="0" cellpadding="0" bordercolor="#e5cfab">
            <tr>
	            <td class="grid-title">原料异议记录</td>
	        </tr>
	        <tr>
	            <td class="grid-back">
                    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:SCMConnectionString1 %>" 
                        onselected="SqlDataSource1_Selected" ></asp:SqlDataSource>
                    <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
                        AutoGenerateColumns="False" CssClass="grid" DataKeyNames="ID,已处理" 
                        DataSourceID="SqlDataSource1" 
                        GridLines="None" ondatabound="GridView1_DataBound" 
                        onpageindexchanged="GridView1_PageIndexChanged" AllowSorting="True" 
                        UseAccessibleHeader="False" onselectedindexchanged="GridView1_SelectedIndexChanged" >
                        <PagerSettings Visible="False" />
                        <RowStyle CssClass="grid-row-normal" />
                        <Columns>
                                                       
                            <asp:TemplateField HeaderText="">
                                <ItemTemplate>
                                    <asp:Button ID="Button1" runat="server" CommandName="Select" Text="选择" CssClass="hide"/>
                                    <img src="/Icons/online.gif" style="margin-top:2px;" alt="" />
                                </ItemTemplate>
                                <HeaderStyle CssClass="grid-header" />
                                <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="20px" />
                            </asp:TemplateField>

                            <asp:TemplateField HeaderText="原料类别" SortExpression="原料类别">
                                <ItemTemplate>
                                    <asp:Label ID="Label2" runat="server" Text='<%# Bind("原料类别") %>'></asp:Label>
                                </ItemTemplate>
                                <HeaderStyle CssClass="grid-header" />
                                <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="100px" />
                            </asp:TemplateField>
                            
                            <asp:TemplateField HeaderText="供货单位" SortExpression="供货单位">
                                <ItemTemplate>
                                    <asp:Label ID="Label3" runat="server" Text='<%# Bind("供货单位") %>'></asp:Label>
                                </ItemTemplate>
                                <HeaderStyle CssClass="grid-header" />
                                <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="100px" />
                            </asp:TemplateField>
                            
                            <asp:TemplateField HeaderText="使用分厂" SortExpression="分厂">
                                <ItemTemplate>
                                    <asp:Label ID="Label4" runat="server" Text='<%# Bind("分厂") %>'></asp:Label>
                                </ItemTemplate>
                                <HeaderStyle CssClass="grid-header" />
                                <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="60px" />
                            </asp:TemplateField>
                            
                            <asp:TemplateField HeaderText="炉号" SortExpression="炉号">
                                <ItemTemplate>
                                    <asp:Label ID="Label5" runat="server" Text='<%# Bind("炉号") %>'></asp:Label>
                                </ItemTemplate>
                                <HeaderStyle CssClass="grid-header" />
                                <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="80px" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="支数" SortExpression="数量">
                                <ItemTemplate>
                                    <asp:Label ID="Label6" runat="server" Text='<%# Bind("数量") %>'></asp:Label>
                                </ItemTemplate>
                                <HeaderStyle CssClass="grid-header" />
                                <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="50px" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="重量(吨)" SortExpression="重量">
                                <ItemTemplate>
                                    <asp:Label ID="Label7" runat="server" Text='<%# Bind("重量") %>'></asp:Label>
                                </ItemTemplate>
                                <HeaderStyle CssClass="grid-header" />
                                <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="80px" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="存储区域" SortExpression="存储区域">
                                <ItemTemplate>
                                    <asp:Label ID="Label8" runat="server" Text='<%# Bind("存储区域") %>'></asp:Label>
                                </ItemTemplate>
                                <HeaderStyle CssClass="grid-header" />
                                <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="50px" />
                            </asp:TemplateField>                           
                            <asp:TemplateField HeaderText="日期" SortExpression="日期">
                                <ItemTemplate>
                                    <asp:Label ID="Label9" runat="server" Text='<%# Bind("日期","{0:d}") %>'></asp:Label>
                                </ItemTemplate>
                                <HeaderStyle CssClass="grid-header" />
                                <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="80px" />
                            </asp:TemplateField>   
                            <asp:TemplateField HeaderText="处理日期" SortExpression="处理日期">
                                <ItemTemplate>
                                    <asp:Label ID="Label10" runat="server" Text='<%# Bind("处理日期","{0:d}") %>'></asp:Label>
                                </ItemTemplate>
                                <HeaderStyle CssClass="grid-header" />
                                <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="80px" />
                            </asp:TemplateField>                            
                        </Columns>
                        <SelectedRowStyle CssClass="grid-row-selected" />
                      </asp:GridView>
	            </td>
            </tr>
            <tr>
	            <td>   
	                <table width="100%">
	                    <tr>
	                        <td class="pagebar">
                                <asp:Button ID="Button_Pager_First" runat="server" Text="" ToolTip="首页" 
                                    CssClass="pageturn-first-b" onclick="Pager_Click" CommandName="--" />
                                <asp:Button ID="Button_Pager_Prev" runat="server" Text="" ToolTip="上一页" 
                                    CssClass="pageturn-prev-b" onclick="Pager_Click" CommandName="-" />
                                <input type="button" class="page-split" />第<asp:TextBox ID="TextBox_Pager" runat="server" CssClass="pageturn" 
                                    ontextchanged="Pager_Click"></asp:TextBox>页<input type="button" class="page-split" /><asp:Label ID="Label_Pages" runat="server"></asp:Label><input type="button" class="page-split" />
                                
                                <asp:Button ID="Button_Pager_Next" runat="server" Text="" ToolTip="下一页" 
                                    CssClass="pageturn-next-b" onclick="Pager_Click" CommandName="+" />
                                <asp:Button ID="Button_Pager_Last" runat="server" Text="" ToolTip="末页" 
                                    CssClass="pageturn-last-b" onclick="Pager_Click" CommandName="++" />
                            </td>
                            <td class="pagebar" align="right">
                                <asp:Label ID="Label_Total" runat="server"></asp:Label>
                            </td>
                        </tr>
                   </table>

	            </td>
            </tr>
        </table>
    </div>
</div>

</form>
<script>
    var textboxs = document.getElementsByTagName("input");
    var i;
    for (i = 0; i < textboxs.length; i++) {
        if (textboxs[i].className == "textbox") {
            textboxs[i].onchange = function(e) { this.className = "textbox-changed"; };
            textboxs[i].onfocus = function(e) { this.select(); };
        }
        else if (textboxs[i].className == "pageturn" || textboxs[i].className == "intxt1" || textboxs[i].className == "intxt2") {
            textboxs[i].onfocus = function(e) { this.select(); };
        }

    }
    var rows = document.getElementsByTagName("tr");
    for (i = 0; i < rows.length; i++) {

        if (rows[i].className == "grid-row-normal") {
            rows[i].onmouseover = function() { this.className = "grid-row-bright"; };
            rows[i].onmouseout = function() { this.className = "grid-row-normal"; };
            rows[i].onclick = function() { this.firstChild.firstChild.click(); };
        }
    }
    var tds = document.getElementsByTagName("td");
    for (i = 0; i < tds.length; i++) {
        if (tds[i].className == "detailheader") {
            tds[i].innerHTML = tds[i].innerHTML.replace("*", "<span class=required>*</span>");
        }
    }

    function pick(o) {
        obj.value = o.title;
        if (obj == document.getElementById("Date1")) {
            document.getElementById("Date2").value = obj.value;
        }
        hidecalendar();
        obj.fireEvent("onchange");
    }
    function picktoday() {
        obj.value = today.getFullYear() + "年" + (today.getMonth() + 1) + "月" + today.getDate() + "日";
        if (obj == document.getElementById("Date1")) {
            document.getElementById("Date2").value = obj.value;
        }
        hidecalendar();
        obj.fireEvent("onchange");
    }

</script>
</body>
</html>
